import os

from selenium import webdriver
from selenium.webdriver.common.by import By
import  time

driver = webdriver.Chrome()
path =os.path.join(os.path.abspath('html3'),'radio-checkbox.html')
driver.get(path)


#选中男生点击
boy=driver.find_element(By.ID,'boy')
print(boy.is_selected())#男生是否选中,返回一个bool的值
boy.click()
time.sleep(2)
print(boy.is_selected())


girl = driver.find_element(By.ID,'girl')
girl.click()
time.sleep(2)
print(girl.is_selected())#女生是否选中,返回一个bool的值

time.sleep(2)
driver.quit()


